package org.atlantis.uzw.base.redis;

import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class JedisPoolFactory {

	public static JedisPool createPool(String host, int port, int timeout, int threadCount) {
		JedisPoolConfig poolConfig = new JedisPoolConfig();
		poolConfig.setMaxIdle(threadCount);
		poolConfig.setMaxActive(threadCount);
		poolConfig.setTimeBetweenEvictionRunsMillis(-1);

		return new JedisPool(poolConfig, host, port, timeout);
	}
}
